/*
 * Copyright (c) gitee.com/jiandong001.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */


//package com.facebook.yoga;

//todo enum
export const enum LayoutPassReason {
  INITIAL = 0,
  ABS_LAYOUT = 1,
  STRETCH = 2,
  MULTILINE_STRETCH = 3,
  FLEX_LAYOUT = 4,
  MEASURE = 5,
  ABS_MEASURE = 6,
  FLEX_MEASURE = 7
}
//  private readonly mIntValue: number;
//
//  constructor(intValue: number) {
//    this.mIntValue = intValue;
//  }
//
//  public intValue(): number {
//    return this.mIntValue;
//  }

  //todo useless
export function getLayoutPassReasonFromNumber(value: number): LayoutPassReason | never {
  switch (value) {
    case 0: return LayoutPassReason.INITIAL;
    case 1: return LayoutPassReason.ABS_LAYOUT;
    case 2: return LayoutPassReason.STRETCH;
    case 3: return LayoutPassReason.MULTILINE_STRETCH;
    case 4: return LayoutPassReason.FLEX_LAYOUT;
    case 5: return LayoutPassReason.MEASURE;
    case 6: return LayoutPassReason.ABS_MEASURE;
    case 7: return LayoutPassReason.FLEX_MEASURE;
    default: throw new Error("Unknown enum value: " + value);
  }
}
